Skip to content

fix: send DTMF to active session room#2010

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
stuffing-craves-channels
Open

fix: send DTMF to active session room#2010
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
stuffing-craves-channels

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the beta sendDtmfEvents tool to publish SIP DTMF from the active AgentSession RoomIO room.
  • Fall back to getJobContext().room when the tool runs without an active RoomIO, matching the Python behavior.
  • Export the tool through the existing beta tools namespace and add a minor changeset for the new beta public API.

Source diff coverage

Coverage classification
  • livekit-agents/livekit/agents/beta/tools/send_dtmf.py: adapted to agents/src/beta/tools/send_dtmf.ts. The target did not have the Python beta DTMF tool or IVR module, but it has equivalent tool execution context and RoomIO access. This PR ports the tool behavior by resolving the active session room from ctx.session._roomIO?.rtcRoom, falling back to getJobContext().room, then publishing each DTMF event via room.localParticipant.publishDtmf(code, digit) with the same per-event delay and success/failure messages.
  • livekit-agents/livekit/agents/beta/tools/send_dtmf.py: adapted exports to agents/src/beta/tools/index.ts and agents/src/beta/index.ts because JS exposes beta tools through namespace index files rather than Python package __init__.py changes in the source diff.
  • Source tests: not applicable; PR #6360 did not add or modify tests.

Validation

  • pnpm build: passed.
  • pnpm lint: passed with existing warnings.
  • pnpm test agents: failed in existing unrelated agents/src/voice/amd.test.ts cases (11 failures); no DTMF tests were added by the source change.
  • pnpm api:check: failed before checking this package because unrelated plugin packages lack api-extractor.json (@livekit/agents-plugin-liveavatar, @livekit/agents-plugin-bey).
  • pnpm --filter @livekit/agents api:check: failed on existing API Extractor limitation for export * as ___ in agents/dist/index.d.ts.

Notes

  • No source diff infrastructure was silently dropped. The target lacked the Python beta DTMF tool, so this PR ports the minimal missing counterpart needed for the active-session-room behavior.
  • cue-cli validation was not run because this change does not modify the voice pipeline; it adds a beta tool that uses existing tool context and RoomIO surfaces.

Ported from livekit/agents#6360

Original PR description

The send_dtmf_events tool resolved the room from the job context, which is always the original caller room. During a warm transfer the tool runs in a separate session bound to a different room, so DTMF was published to the caller instead of the transferee.

This resolves the room from the run context session (ctx.session.room_io.room), falling back to the job context when the session has no room I/O.

Fixes #6357

@rosetta-livekit-bot rosetta-livekit-bot Bot requested a review from a team as a code owner July 9, 2026 12:21
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4db7d01

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@livekit/agents Major
@livekit/agents-plugin-anam Major
@livekit/agents-plugin-anthropic Major
@livekit/agents-plugin-assemblyai Major
@livekit/agents-plugin-baseten Major
@livekit/agents-plugin-bey Major
@livekit/agents-plugin-cartesia Major
@livekit/agents-plugin-cerebras Major
@livekit/agents-plugin-deepgram Major
@livekit/agents-plugin-did Major
@livekit/agents-plugin-elevenlabs Major
@livekit/agents-plugin-fishaudio Major
@livekit/agents-plugin-google Major
@livekit/agents-plugin-hedra Major
@livekit/agents-plugin-hume Major
@livekit/agents-plugin-inworld Major
@livekit/agents-plugin-lemonslice Major
@livekit/agents-plugin-liveavatar Major
@livekit/agents-plugin-livekit Major
@livekit/agents-plugin-minimax Major
@livekit/agents-plugin-mistral Major
@livekit/agents-plugin-mistralai Major
@livekit/agents-plugin-neuphonic Major
@livekit/agents-plugin-openai Major
@livekit/agents-plugin-perplexity Major
@livekit/agents-plugin-phonic Major
@livekit/agents-plugin-resemble Major
@livekit/agents-plugin-rime Major
@livekit/agents-plugin-runway Major
@livekit/agents-plugin-sarvam Major
@livekit/agents-plugin-silero Major
@livekit/agents-plugin-soniox Major
@livekit/agents-plugin-tavus Major
@livekit/agents-plugins-test Major
@livekit/agents-plugin-trugen Major
@livekit/agents-plugin-xai Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rosetta-livekit-bot rosetta-livekit-bot Bot requested a review from longcw July 9, 2026 12:22

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants